package ee.ui.properties

import scala.language.implicitConversions

trait ReadOnlyProperty[T] extends ObservableProperty[T] {
  def value: T
  def get: T = value
}

object ReadOnlyProperty {
  @inline implicit def propertyToValue[T](property: ReadOnlyProperty[T]): T = property.value

  @inline implicit def propertyTupleToValues2[T1, T2](t: (ReadOnlyProperty[T1], ReadOnlyProperty[T2])): (T1, T2) = (t._1, t._2)
  @inline implicit def propertyTupleToValues3[T1, T2, T3](t: (ReadOnlyProperty[T1], ReadOnlyProperty[T2], ReadOnlyProperty[T3])): (T1, T2, T3) = (t._1, t._2, t._3)
  @inline implicit def propertyTupleToValues4[T1, T2, T3, T4](t: (ReadOnlyProperty[T1], ReadOnlyProperty[T2], ReadOnlyProperty[T3], ReadOnlyProperty[T4])): (T1, T2, T3, T4) = (t._1, t._2, t._3, t._4)
  @inline implicit def propertyTupleToValues5[T1, T2, T3, T4, T5](t: (ReadOnlyProperty[T1], ReadOnlyProperty[T2], ReadOnlyProperty[T3], ReadOnlyProperty[T4], ReadOnlyProperty[T5])): (T1, T2, T3, T4, T5) = (t._1, t._2, t._3, t._4, t._5)
  @inline implicit def propertyTupleToValues6[T1, T2, T3, T4, T5, T6](t: (ReadOnlyProperty[T1], ReadOnlyProperty[T2], ReadOnlyProperty[T3], ReadOnlyProperty[T4], ReadOnlyProperty[T5], ReadOnlyProperty[T6])): (T1, T2, T3, T4, T5, T6) = (t._1, t._2, t._3, t._4, t._5, t._6)
  @inline implicit def propertyTupleToValues7[T1, T2, T3, T4, T5, T6, T7](t: (ReadOnlyProperty[T1], ReadOnlyProperty[T2], ReadOnlyProperty[T3], ReadOnlyProperty[T4], ReadOnlyProperty[T5], ReadOnlyProperty[T6], ReadOnlyProperty[T7])): (T1, T2, T3, T4, T5, T6, T7) = (t._1, t._2, t._3, t._4, t._5, t._6, t._7)
  @inline implicit def propertyTupleToValues8[T1, T2, T3, T4, T5, T6, T7, T8](t: (ReadOnlyProperty[T1], ReadOnlyProperty[T2], ReadOnlyProperty[T3], ReadOnlyProperty[T4], ReadOnlyProperty[T5], ReadOnlyProperty[T6], ReadOnlyProperty[T7], ReadOnlyProperty[T8])): (T1, T2, T3, T4, T5, T6, T7, T8) = (t._1, t._2, t._3, t._4, t._5, t._6, t._7, t._8)
  @inline implicit def propertyTupleToValues9[T1, T2, T3, T4, T5, T6, T7, T8, T9](t: (ReadOnlyProperty[T1], ReadOnlyProperty[T2], ReadOnlyProperty[T3], ReadOnlyProperty[T4], ReadOnlyProperty[T5], ReadOnlyProperty[T6], ReadOnlyProperty[T7], ReadOnlyProperty[T8], ReadOnlyProperty[T9])): (T1, T2, T3, T4, T5, T6, T7, T8, T9) = (t._1, t._2, t._3, t._4, t._5, t._6, t._7, t._8, t._9)
  @inline implicit def propertyTupleToValues10[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10](t: (ReadOnlyProperty[T1], ReadOnlyProperty[T2], ReadOnlyProperty[T3], ReadOnlyProperty[T4], ReadOnlyProperty[T5], ReadOnlyProperty[T6], ReadOnlyProperty[T7], ReadOnlyProperty[T8], ReadOnlyProperty[T9], ReadOnlyProperty[T10])): (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10) = (t._1, t._2, t._3, t._4, t._5, t._6, t._7, t._8, t._9, t._10)
  @inline implicit def propertyTupleToValues11[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11](t: (ReadOnlyProperty[T1], ReadOnlyProperty[T2], ReadOnlyProperty[T3], ReadOnlyProperty[T4], ReadOnlyProperty[T5], ReadOnlyProperty[T6], ReadOnlyProperty[T7], ReadOnlyProperty[T8], ReadOnlyProperty[T9], ReadOnlyProperty[T10], ReadOnlyProperty[T11])): (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11) = (t._1, t._2, t._3, t._4, t._5, t._6, t._7, t._8, t._9, t._10, t._11)
  @inline implicit def propertyTupleToValues12[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12](t: (ReadOnlyProperty[T1], ReadOnlyProperty[T2], ReadOnlyProperty[T3], ReadOnlyProperty[T4], ReadOnlyProperty[T5], ReadOnlyProperty[T6], ReadOnlyProperty[T7], ReadOnlyProperty[T8], ReadOnlyProperty[T9], ReadOnlyProperty[T10], ReadOnlyProperty[T11], ReadOnlyProperty[T12])): (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12) = (t._1, t._2, t._3, t._4, t._5, t._6, t._7, t._8, t._9, t._10, t._11, t._12)
  @inline implicit def propertyTupleToValues13[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13](t: (ReadOnlyProperty[T1], ReadOnlyProperty[T2], ReadOnlyProperty[T3], ReadOnlyProperty[T4], ReadOnlyProperty[T5], ReadOnlyProperty[T6], ReadOnlyProperty[T7], ReadOnlyProperty[T8], ReadOnlyProperty[T9], ReadOnlyProperty[T10], ReadOnlyProperty[T11], ReadOnlyProperty[T12], ReadOnlyProperty[T13])): (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13) = (t._1, t._2, t._3, t._4, t._5, t._6, t._7, t._8, t._9, t._10, t._11, t._12, t._13)
  @inline implicit def propertyTupleToValues14[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14](t: (ReadOnlyProperty[T1], ReadOnlyProperty[T2], ReadOnlyProperty[T3], ReadOnlyProperty[T4], ReadOnlyProperty[T5], ReadOnlyProperty[T6], ReadOnlyProperty[T7], ReadOnlyProperty[T8], ReadOnlyProperty[T9], ReadOnlyProperty[T10], ReadOnlyProperty[T11], ReadOnlyProperty[T12], ReadOnlyProperty[T13], ReadOnlyProperty[T14])): (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14) = (t._1, t._2, t._3, t._4, t._5, t._6, t._7, t._8, t._9, t._10, t._11, t._12, t._13, t._14)
  @inline implicit def propertyTupleToValues15[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15](t: (ReadOnlyProperty[T1], ReadOnlyProperty[T2], ReadOnlyProperty[T3], ReadOnlyProperty[T4], ReadOnlyProperty[T5], ReadOnlyProperty[T6], ReadOnlyProperty[T7], ReadOnlyProperty[T8], ReadOnlyProperty[T9], ReadOnlyProperty[T10], ReadOnlyProperty[T11], ReadOnlyProperty[T12], ReadOnlyProperty[T13], ReadOnlyProperty[T14], ReadOnlyProperty[T15])): (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15) = (t._1, t._2, t._3, t._4, t._5, t._6, t._7, t._8, t._9, t._10, t._11, t._12, t._13, t._14, t._15)
  @inline implicit def propertyTupleToValues16[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16](t: (ReadOnlyProperty[T1], ReadOnlyProperty[T2], ReadOnlyProperty[T3], ReadOnlyProperty[T4], ReadOnlyProperty[T5], ReadOnlyProperty[T6], ReadOnlyProperty[T7], ReadOnlyProperty[T8], ReadOnlyProperty[T9], ReadOnlyProperty[T10], ReadOnlyProperty[T11], ReadOnlyProperty[T12], ReadOnlyProperty[T13], ReadOnlyProperty[T14], ReadOnlyProperty[T15], ReadOnlyProperty[T16])): (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16) = (t._1, t._2, t._3, t._4, t._5, t._6, t._7, t._8, t._9, t._10, t._11, t._12, t._13, t._14, t._15, t._16)
  @inline implicit def propertyTupleToValues17[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17](t: (ReadOnlyProperty[T1], ReadOnlyProperty[T2], ReadOnlyProperty[T3], ReadOnlyProperty[T4], ReadOnlyProperty[T5], ReadOnlyProperty[T6], ReadOnlyProperty[T7], ReadOnlyProperty[T8], ReadOnlyProperty[T9], ReadOnlyProperty[T10], ReadOnlyProperty[T11], ReadOnlyProperty[T12], ReadOnlyProperty[T13], ReadOnlyProperty[T14], ReadOnlyProperty[T15], ReadOnlyProperty[T16], ReadOnlyProperty[T17])): (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17) = (t._1, t._2, t._3, t._4, t._5, t._6, t._7, t._8, t._9, t._10, t._11, t._12, t._13, t._14, t._15, t._16, t._17)
  @inline implicit def propertyTupleToValues18[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18](t: (ReadOnlyProperty[T1], ReadOnlyProperty[T2], ReadOnlyProperty[T3], ReadOnlyProperty[T4], ReadOnlyProperty[T5], ReadOnlyProperty[T6], ReadOnlyProperty[T7], ReadOnlyProperty[T8], ReadOnlyProperty[T9], ReadOnlyProperty[T10], ReadOnlyProperty[T11], ReadOnlyProperty[T12], ReadOnlyProperty[T13], ReadOnlyProperty[T14], ReadOnlyProperty[T15], ReadOnlyProperty[T16], ReadOnlyProperty[T17], ReadOnlyProperty[T18])): (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18) = (t._1, t._2, t._3, t._4, t._5, t._6, t._7, t._8, t._9, t._10, t._11, t._12, t._13, t._14, t._15, t._16, t._17, t._18)
  @inline implicit def propertyTupleToValues19[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19](t: (ReadOnlyProperty[T1], ReadOnlyProperty[T2], ReadOnlyProperty[T3], ReadOnlyProperty[T4], ReadOnlyProperty[T5], ReadOnlyProperty[T6], ReadOnlyProperty[T7], ReadOnlyProperty[T8], ReadOnlyProperty[T9], ReadOnlyProperty[T10], ReadOnlyProperty[T11], ReadOnlyProperty[T12], ReadOnlyProperty[T13], ReadOnlyProperty[T14], ReadOnlyProperty[T15], ReadOnlyProperty[T16], ReadOnlyProperty[T17], ReadOnlyProperty[T18], ReadOnlyProperty[T19])): (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19) = (t._1, t._2, t._3, t._4, t._5, t._6, t._7, t._8, t._9, t._10, t._11, t._12, t._13, t._14, t._15, t._16, t._17, t._18, t._19)
  @inline implicit def propertyTupleToValues20[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20](t: (ReadOnlyProperty[T1], ReadOnlyProperty[T2], ReadOnlyProperty[T3], ReadOnlyProperty[T4], ReadOnlyProperty[T5], ReadOnlyProperty[T6], ReadOnlyProperty[T7], ReadOnlyProperty[T8], ReadOnlyProperty[T9], ReadOnlyProperty[T10], ReadOnlyProperty[T11], ReadOnlyProperty[T12], ReadOnlyProperty[T13], ReadOnlyProperty[T14], ReadOnlyProperty[T15], ReadOnlyProperty[T16], ReadOnlyProperty[T17], ReadOnlyProperty[T18], ReadOnlyProperty[T19], ReadOnlyProperty[T20])): (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20) = (t._1, t._2, t._3, t._4, t._5, t._6, t._7, t._8, t._9, t._10, t._11, t._12, t._13, t._14, t._15, t._16, t._17, t._18, t._19, t._20)
  @inline implicit def propertyTupleToValues21[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21](t: (ReadOnlyProperty[T1], ReadOnlyProperty[T2], ReadOnlyProperty[T3], ReadOnlyProperty[T4], ReadOnlyProperty[T5], ReadOnlyProperty[T6], ReadOnlyProperty[T7], ReadOnlyProperty[T8], ReadOnlyProperty[T9], ReadOnlyProperty[T10], ReadOnlyProperty[T11], ReadOnlyProperty[T12], ReadOnlyProperty[T13], ReadOnlyProperty[T14], ReadOnlyProperty[T15], ReadOnlyProperty[T16], ReadOnlyProperty[T17], ReadOnlyProperty[T18], ReadOnlyProperty[T19], ReadOnlyProperty[T20], ReadOnlyProperty[T21])): (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21) = (t._1, t._2, t._3, t._4, t._5, t._6, t._7, t._8, t._9, t._10, t._11, t._12, t._13, t._14, t._15, t._16, t._17, t._18, t._19, t._20, t._21)
  @inline implicit def propertyTupleToValues22[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22](t: (ReadOnlyProperty[T1], ReadOnlyProperty[T2], ReadOnlyProperty[T3], ReadOnlyProperty[T4], ReadOnlyProperty[T5], ReadOnlyProperty[T6], ReadOnlyProperty[T7], ReadOnlyProperty[T8], ReadOnlyProperty[T9], ReadOnlyProperty[T10], ReadOnlyProperty[T11], ReadOnlyProperty[T12], ReadOnlyProperty[T13], ReadOnlyProperty[T14], ReadOnlyProperty[T15], ReadOnlyProperty[T16], ReadOnlyProperty[T17], ReadOnlyProperty[T18], ReadOnlyProperty[T19], ReadOnlyProperty[T20], ReadOnlyProperty[T21], ReadOnlyProperty[T22])): (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22) = (t._1, t._2, t._3, t._4, t._5, t._6, t._7, t._8, t._9, t._10, t._11, t._12, t._13, t._14, t._15, t._16, t._17, t._18, t._19, t._20, t._21, t._22)

}

object ReadOnlyPropertyTupleToValueGeneration {

  def main(args: Array[String]) {

    import ee.util.Generate._
    
    val result = (2 to 22).map { i =>
      val readOnlyProperties = generateTypeClasses("ReadOnlyProperty", i)
      val types = generateTypes(i)
      val tupleValues = generateStrings(i, "t._")

      s"@inline implicit def propertyTupleToValues$i[$types](t: ($readOnlyProperties)): ($types) = ($tupleValues)"
    }.mkString("\n")
    println(result)
  }

}
